﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Castle.ActiveRecord;
using Entity;

namespace ImageLoader.Controllers
{
    public class ImageLoaderController : Controller
    {
        public ActionResult Narrow(int? id)
        {
            var annex = ActiveRecordBase<Annex>.TryFind(id);
            string path;
            if (annex != null)
            {
                path = annex.AnnexDomain + annex.AnnexNarrowPath;
            }
            else
            {
                path = "/Content/nophoto.jpg";
            }
            string contentType;
            switch ("")
            {
                default:
                    contentType = "image/jpeg";
                    break;
            }
            return File(path, contentType);
        }
        public ActionResult Original(int? id)
        {
            var annex = ActiveRecordBase<Annex>.TryFind(id);
            string path;
            if (annex != null)
            {
                path = annex.AnnexDomain + annex.AnnexOriginalPath;
            }
            else
            {
                path = "/Content/nophoto.jpg";
            }
            string contentType;
            switch ("")
            {
                default:
                    contentType = "image/jpeg";
                    break;
            }
            return File(path, contentType);
        }
    }
}
